/*
 * Created on 2005-8-20
 *
 */
package com.yl.cap.analyst.test;

import org.springframework.context.ApplicationContext;
import com.yl.cap.analyst.report.service.ReportService;
import com.yl.cap.analyst.util.mail.MailInfo;
import com.yl.cap.analyst.util.mail.SendMail;

/**
 * @author ZhangQi
 *
 */
public class MailTester
{

    public static void main(String[] args)
    {
        try
        {
            ApplicationContext ctx = TestHelper.getContext();
            ReportService service = (ReportService) ctx.getBean("reportService");
            boolean ret = service.sendReportEmail("4028818b05c68da60105c68e3bb50001");
            System.out.println(ret);
            //MailInfo info = (MailInfo) ctx.getBean("info");
            /*MailInfo info = new MailInfo();
            info.setBody("ttttttt");
            info.setFrom("todayhill@126.com");
            info.setNeedAuth(true);
            info.setSmtpName("todayhill");
            info.setSmtpHost("smtp.126.com");
            info.setSmtpPass("100085");
            info.setSubject("test");*/
            //SendMail mail = new SendMail(info);
            /*SendMail mail = new SendMail(info.getSmtpHost());
            mail.setSubject(info.getSubject());
            mail.setFrom(info.getFrom());
            mail.setBody(info.getBody());
            mail.setNamePass(info.getSmtpName(),info.getSmtpPass());
            mail.setTo("todayhill@126.com,todayhill@tom.com");
            mail.sendout();*/
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}
